package com.mayisoftware.mayioa.business.human.impl.controller.humanmanager;

import com.mayisoftware.mayioa.business.human.api.domain.HumanSearchInfo;
import com.mayisoftware.mayioa.business.human.api.domain.humanmanager.HumanTurnOverInfo;
import com.mayisoftware.mayioa.business.human.api.service.humanmanager.IHumanTurnOverService;
import com.mayisoftware.mayioa.platform.api.service.ISysDictDataService;
import com.mayisoftware.mayioa.platform.impl.web.base.BaseController;
import com.mayisoftware.mayioa.platform.impl.web.page.TableDataInfo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 骨干统计控制器
 */
@Controller
@RequestMapping("/human/turnover")
public class HumanTurnOverController extends BaseController{
    /**
    * 统计服务
     */
    @Autowired
    private IHumanTurnOverService turnOverService;
    @Autowired
    private ISysDictDataService dictService;
    /**
     * 前缀
     */
    private String prefix = "human/turnover";

    /**
     * 最大显示条数
     */
    private final  static Integer MAX_VIEW =5;

    /**
     * 统计页面
     */
    @RequiresPermissions("human:turnover:view")
    @GetMapping()
    public String staff()
    {
        return prefix + "/turnover";
    }


    @RequiresPermissions("human:turnover:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(HumanSearchInfo searchInfo)
    {
        startPage();
        List<HumanTurnOverInfo> list = turnOverService.getTurnOverInfos(searchInfo);
        return getDataTable(list);
    }

}
